<?php

/**
 * Clase para generar reporte Peso
 * @author Mauricio Chamorro <mrchamorro@utn.edu.ec>
 */
$this->Widget('ext.highcharts.HighchartsWidget', array(
    'scripts' => array(
        'modules/exporting',
    ),
     'nombreChart' => $nombreChart,
    'options' => array(
        'colors' => ['#EBAB17', '#FF9655', '#48DB6B', '#FFB0F2', '#373CDB', '#FF9655',],
        'chart' => array(
//            'events' => array(
//                'load' => 'js:function(){Highcharts.drawTable(2)}',//2 porque es el 3er chart en renderizar
//            ),
            'height' => '500',
            'backgroundColor' => array(
                'linearGradient' => array('x1' => 0, 'y1' => 0, 'x2' => 1, 'y2' => 1),
                'stops' => array(array(
                        0, 'rgb(255, 255, 255)'),
                    array(1, 'rgb(240, 240, 255)')
                )),
            'zoomType' => 'xy',
            'spacingRight' => 20,
        ),
        'borderWidth' => 1,
        'plotBackgroundColor' => 'rgba(255, 255, 255,.99)',
        'plotShadow' => true,
        'plotBorderWidth' => 1,
        'title' => array('text' => $ninio->genero=="FEMENINO"?" Seguimiento de Peso para la edad Niña ":" Seguimiento de Peso para la edad Niño"),
        'credits' => array(
            'enabled' => false,
        ),
        'subtitle' => array(
            'text' => "Infante: " . $ninio->nombre_completo,
        ),
        'xAxis' => array(
            "tickPixelInterval" => 50,
//            "tickInterval" => 1,
            'title' => array('text' => 'Edad meses cumplidos'),
//            'gridLineWidth' => 1,
//            'lineColor' => '#000',
//            'tickColor' => '#000',
//            'allowDecimals' => true,
            'categories' => $reporte['xAxis']['categories'],
            'labels' => array(
                'rotation' => -45
            ),
        ),
        'plotOptions' => array(
            "series" => array("marker" =>
                array("enabled" => false, //TODO
                    "states" => array(
                        "hover" => array(
                            "enabled" => true, "radius" => 5)
                    )
                ),),
            "area" => array("lineWidth" => 1,
                "shadow" => false,
            ),
        ),
        'tooltip' => array(
            'enabled'=>false,
//            'positioner' => "js: function () {return { x: 80, y: 100 };}",
//            'shadow' => false,
//            'crosshairs' => [true],
//            'shared' => true,
//            'borderWidth' => 3,
//            'backgroundColor' => 'rgba(255,255,255,0.9)'
        ),
        'yAxis' => array(
            'min' => 0,
            'max' => 40,
            'minorTickInterval' => 'auto',
            'title' => array('text' => 'Peso (kg)'),
            'lineColor' => '#000',
            'lineWidth' => 1,
            'tickWidth' => 1,
            'tickColor' => '#000',
            'zIndex'=> -999999999999,
        ),
        'series' => $reporte['series']
    ),
));
?>